

<style>
.hover {
  background-color: #888888;
}
#pending_todos ul li, #completed_todos ul li {
  list-style: none;
  cursor: move;
}
#pending_todos, #completed_todos {
  border: 1px solid gray;
}
</style>

<h1>Todo list for <%= @consultation.code %></h1>


<h2>Pending</h2>
<div id="pending_todos">
  <%= render :partial=>"pending_todos" %>
</div>

<h2>Completed</h2>
<div id="completed_todos">
  <%= render :partial=>"completed_todos" %>
</div>



<%= drop_receiving_element('pending_todos', 
      :accept     => 'completed_todo', 
      :complete   => "$('spinner').hide();",
      :before     => "$('spinner').show();",
      :hoverclass => 'hover',
      :with       => "'todo=' + encodeURIComponent(element.id.split('_').last())",
      :url        => {:controller=>:ajax, :action=>:todo_pending, :id=>@consultation})%>

<%= drop_receiving_element('completed_todos',
      :accept     => 'pending_todo', 
      :complete   => "$('spinner').hide();",
      :before     => "$('spinner').show();",
      :hoverclass => 'hover',
      :with       => "'todo=' + encodeURIComponent(element.id.split('_').last())",
      :url        => {:controller=>:ajax, :action=>:todo_completed, :id=>@consultation})%>
